<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
        <style type="text/css">
            .content_cantainer {
                font-family:"微软雅黑";
            }
            img {
                max-width:96%;
            }
        </style>
        <script type="text/javascript">
            
            function images_onload() {
                var imgs = document.getElementsByTagName("img");
                for (var i = 0; i < imgs.length; i++) {
                    var p = getParagraph(imgs[i]);
                    
                    if (p) {
                        p.style.textAlign = "center";
                        p.style.textIndent = "0px";
                    }
                    
                    imgs[i].onload = function() {
                        var height = document.body.offsetHeight + 15;
                        window.webkit.messageHandlers.WebHeight.postMessage({height: height});
                    }
                }
                var height = document.body.offsetHeight + 15;
                window.webkit.messageHandlers.WebHeight.postMessage({height: height});
            }
            
            function setContent(content) {
                var div = document.getElementById("content");
                div.innerHTML = content;
                
                var imgs = document.getElementsByTagName("img");
                for (var i = 0; i < imgs.length; i++) {
                    var p = getParagraph(imgs[i]);
                    
                    if (p) {
                        p.style.textAlign = "center";
                        p.style.textIndent = "0px";
                    }
                    
                    imgs[i].onload = function() {
                        var height = document.body.offsetHeight + 15;
                        window.webkit.messageHandlers.WebHeight.postMessage({height: height});
                    }
                }
                var height = document.body.offsetHeight + 15;
                window.webkit.messageHandlers.WebHeight.postMessage({height: height});
            }
            
            function getParagraph(node) {
                var target = null;
                
                if (node) node = node.parentNode;
                else return target;
                
                if (node && node.nodeName.toUpperCase() == "P") target = node;
                else
                target = getParagraph(node);
                return target;
            }
            
            function setBackgroundColor(color) {
                document.getElementsByTagName("body")[0].style.backgroundColor = color;
            }
            
        </script>
    </head>
    <body>
        <div class="content_cantainer" id="content">
            $$$$
        </div>
    </body>
</html>
